package com.sq.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Description: TODO
 * @author: ydy
 * @date: 2022-09-02 11:56
 */
@Configuration
public class ApplicationContextConfig {

    @Bean
    //负载均衡，使用@LoadBalance注解赋予RestTemplate负载均衡能力
    //默认轮询方式，你一次我一次
    //@LoadBalanced
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
